package com.bdsys.common.action;

import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.bdsys.common.service.BusinessService;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class BasicAction extends ActionSupport implements RequestAware{
	
	private Map<String, Object> request;
	
	private static BeanFactory applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
	
	public BusinessService getService(String serviceName){
		return (BusinessService)applicationContext.getBean(serviceName);
	}
	
	@Override
	public void setRequest(Map<String, Object> request){
		this.request = request;
	}
	
	public Map<String, Object> getRequest(){
		return this.request;
	}
	

}
